<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>Hello APP</title>
    <link rel="stylesheet" type="text/css" href="../../css/index.css" />
    <link rel="stylesheet" type="text/css" href="../../script/lib/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="css.css" />
    <style>
        html,body{background: #ffffff;}
    	.warp{width: 100%;}
		.pingpai-box{width: 100%;flex-wrap: wrap;padding: 15px 8px;box-sizing: border-box;}
		.pingpai-box .pingpai-one{width: 25%;font-size: 13px;color: #999999;padding: 0 8px;box-sizing: border-box;margin-bottom: 15px;}
		.pingpai-box .pingpai-one .img-box{width: 100%;padding-top: 100%;height: 0;align-items: center;justify-content: center;overflow: hidden;border-radius: 50%;}
		.pingpai-box .pingpai-one .img-box img{width: 100%;display:block;text-align: 0;}
		.pingpai-box .pingpai-one .text{color: #333333;box-sizing: border-box;font-size: 12px;padding-top:10px;text-align: center;}
		.pingpai-box .pingpai-one .bot-box .info-one:last-child:before{display: none;}
    </style>
</head>

<body>
    <div id="vue" class="warp">

        <div class="pingpai-box flex">
        	<div class="pingpai-one" v-for="(item,key) in Pdata.listData" data-type="pinpai" :data-title="item.title" :data-id="item.id" tapmode onclick="open_fenlei(this)">
                <div class="img-box bgpic" :style="{backgroundImage:'url('+item.logo+')'}"></div>
                <div class="text" v-text="item.title"></div>
        	</div>
        </div>

    </div>

    <script type="text/javascript" src="../../script/base.min.js" id="loadjs" data-load="L/swiper.min,L/aui-scroll"></script>
    <script type="text/javascript">
    define(function (require, exports, module) {

        // 用缓存
        var data = lanYun.getStorage('pinpaiData');

        // 加数据
        _page.getData = function(loading) {
            lanYun.getVueData({url:'ShopPinpai/index',get:{page:lanYun.page},cache:1,loading:loading},function(ret) {
                //console.log(JSON.stringify(ret));
            });
        };

        lanYun.newVue('#vue',{
            odata:data
        }, function() {
            _page.getData(2);
        });

        //滚动加载..
		new auiScroll({distance:200, listen:true},function(ret) {
			if($(window).scrollTop() < 2) ret.isToBottom = false;
			if(!ret.isToBottom) return;
			_page.getData(2);
		});

        //打开品牌
	    goPinPai = function (tis) {
	        var dst = tis.dataset;
	        lanYun.openWin('main0/list_pinpai.html', {
	            win:'win',
                title:'商品列表',
	            frameParam : dst
	        });
	    }

        //打开分类
	    goShopList = function (tis) {
	        var dst = tis.dataset;
	        lanYun.openWin('main0/list_shop.html', {
	            win:'none',
	            frameParam : {id:dst.id}
	        });
	    }

        //打开不同分类的链接
        open_fenlei = function (tis) {
            var dst = tis.dataset;
            switch(dst.type){
                case "class":
                    lanYun.openWin('main0/list_shop.html', {win:'none',frameParam : dst});
                    break;
                case "zhuanti":
                    lanYun.openWin('main0/list_zhuanti.html', {win:'win',title:dst.title,frameParam : dst});
                    break;
                case "pinpai":
                    lanYun.openWin('main0/list_pinpai.html', {win:'win',title:dst.title,frameParam : dst});
                    break;
                case "shop":
                    lanYun.openWin('goods/show', {win:'none',frameParam : dst});
                    break;
                case "goods":
                    lanYun.openWin('goods/show', {win:'none',frameParam : dst});
                    break;
                case "none":
                    return;
                    break;
                default:
                    break;
            }
        }
    });
    </script>
</body>
</html>
